package com.javastudy.jdkfeature.jdk7.file;

import java.io.IOException;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;

public class RecursiveFileListDemo {
    public static void main(String[] args) throws IOException {
        Path startPath = Paths.get("F:\\学习文档\\java\\Spring");
        Files.walkFileTree(startPath, new SimpleFileVisitor<Path>(){
            @Override
            public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs){
                System.out.println(">>>>Dir : " + dir);
                return FileVisitResult.CONTINUE;
            }

            @Override
            public FileVisitResult visitFile(Path file, BasicFileAttributes attrs){
//                System.out.println("File : " + file);
                return FileVisitResult.CONTINUE;
            }
        });
    }
}
